package 多线程01_启动线程;

/**
 * @ClassName: 多线程01_启动线程.KillThread01
 * @Author: AllenSun
 * @Date: 2022/3/18 上午12:59
 */
public class KillThread01 extends Thread {
    private Hero h1;
    private Hero h2;

    public KillThread01(Hero h1,Hero h2) {
        this.h1=h1;
        this.h2=h2;
    }

    public void run() {
        while (!h2.isDead()) {
            h1.attactHero(h2);
        }
    }
}
